<template>
  <div id="cart">
        <nav-bar class="nav-car">
            <p slot="center" class="cart-tit">购物车({{cartLength}})</p>
        </nav-bar>
        <cart-list></cart-list>
        <!-- 底部汇总 -->
        <cart-button-bar></cart-button-bar>
  </div>
</template>
<script>
//子组件
import CartList from './childComps/CartList'
import CartButtonBar from './childComps/CartButtonBar'
// 公用组件
import NavBar from 'components/common/navbar/NavBar'

export default {
  name: 'Cart',
  components: {
    CartList,
    CartButtonBar,
     NavBar
    },
    computed: {
      cartLength(){
        return this.$store.state.cartList.length
      }
    },
  directives: {  },
  data() {
    return {
      
    };
  },
  mounted() {
    
  },
  methods: {
  },
};
</script>
<style  scoped>
#cart{
 position: relative;
 height:100vh;
overflow-y: hidden;
}
.nav-car{
    width: 100%;
    background: pink;
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 9;
}
  .cart-tit{
    text-align: center;
    line-height:44px ;
    color: #ffffff;
    font-weight: bold;
  }
</style>